home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / kerberos / pc / krb_libd.lha / Lib / Des / NOOP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  1.8 KB  |  69 lines

  1. /*
  2.  * $Source: /mit/kerberos/src/lib/des/RCS/noop.c,v $
  3.  * $Author: jtkohl $
  4.  *
  5.  * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
  6.  * of Technology.
  7.  *
  8.  * For copying and distribution information, please see the file
  9.  * <mit-copyright.h>.
  10.  *
  11.  * These routines perform encryption and decryption using the DES
  12.  * private key algorithm, or else a subset of it-- fewer inner loops.
  13.  * (AUTH_DES_ITER defaults to 16, may be less.)
  14.  *
  15.  * Under U.S. law, this software may not be exported outside the US
  16.  * without license from the U.S. Commerce department.
  17.  *
  18.  * The key schedule is passed as an arg, as well as the cleartext or
  19.  * ciphertext.
  20.  *
  21.  *  All registers labeled imply Vax using the Ultrix or 4.2bsd compiler.
  22.  *
  23.  *    NOTE:  bit and byte numbering:
  24.  *            DES algorithm is defined in terms of bits of L
  25.  *            followed by bits of R:
  26.  *
  27.  *            bit 0  ==> lsb of L
  28.  *            bit 63 ==> msb of R
  29.  *
  30.  * Always work in register pairs, FROM L1,R1 TO L2,R2 to make
  31.  * bookeeping easier.
  32.  *
  33.  * spm    8/85    MIT project athena
  34.  */
  35.  
  36. #ifndef    lint
  37. static char rcsid_noop_c[] =
  38. "$Header: noop.c,v 4.7 88/11/15 11:30:24 jtkohl Exp $";
  39. #endif    lint
  40.  
  41. #include <mit-copyright.h>
  42. #include <stdio.h>
  43.  
  44. #include <des.h>
  45.  
  46. #ifdef DEBUG
  47. #define DBG_PRINT(s)    if (debug) \
  48.     des_debug_print(s,i,L1&0xffff,(L1>>16)&0xffff, \
  49.         R1&0xffff,(R1>>16)&0xffff)
  50. #else
  51. #define DBG_PRINT(s)
  52. #endif
  53.  
  54. extern    int    des_debug;
  55.  
  56. int
  57. des_ecb_encrypt(clear, cipher, schedule, encrypt)
  58.     unsigned long *clear;
  59.     unsigned long *cipher;
  60.     int encrypt;        /* 0 ==> decrypt, else encrypt */
  61.     register des_key_schedule schedule; /* r11 */
  62. {
  63.     /* a debugging version that only copies input to output */
  64.     *cipher++ = *clear++;
  65.     *cipher = *clear;
  66.  
  67.     return 0;
  68. }
  69.